<?php
require_once '../controller.php';
$c = new Course($params->c);
print "<h2>Annotate $c->title</h2>";
$annotations = $c->getAnnotations();
if(!empty($annotations)) {
	print '<h3>Previous Annotations</h3>';
	foreach($annotations as $a) {
		$date = date('M d, Y \a\t h:m A', $a->date);
		print "<p>$date - $a->comment";
	}
}
print '<br/><br/>';
$term = explode(' ',$c->term);
$form = new Form('annotate_course_form','post');
$form->textInput('course_id','',array('value'=>$c->id,'class'=>'invisible'));
$form->textArea('annotation','New Annotation',4,20,array('tabindex'=>'1'));
$form->button('annotate_course_submit','Annotate',array('type'=>'submit','tabindex'=>'2'),false);
$form->button('annotate_course_cancel','Cancel',array('type'=>'button','tabindex'=>'3','onclick'=>'closePopup();'),false);
die($form->build());